package com.joysuch.wwyt.workflow.entity;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.time.LocalDateTime;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * @Author ZhangDong
 * @Date 2021/1/8 10:00
 */
@Data
@Entity
@EntityListeners({ AuditingEntityListener.class, AutoSetCommonFieldListener.class })
@Table(name = "wwyt_screen_column_config")
@SQLDelete(sql = "update wwyt_screen_column_config set delete_flag = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_screen_column_config set delete_flag = '1' where id= ?")
@Where(clause = "delete_flag = '0'")
public class ScreenColumnConfig {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @ApiModelProperty("主键ID")
    private Long id;
    @ApiModelProperty("专栏类型id")
    private Long typeId;
    @ApiModelProperty("专栏类型名称")
    private String typeName;
    @ApiModelProperty("配置信息")
    private String configJson;

    //通用字段
    @org.springframework.data.annotation.CreatedBy
    @ApiModelProperty("创建人")
    private Long createBy;
    @org.springframework.data.annotation.CreatedDate
    @ApiModelProperty("创建时间")
    private LocalDateTime createTime;
    @org.springframework.data.annotation.LastModifiedBy
    @ApiModelProperty("更新人")
    private Long updateBy;
    @org.springframework.data.annotation.LastModifiedDate
    @ApiModelProperty("更新时间")
    private LocalDateTime updateTime;
    @ApiModelProperty("租户")
    private Long tenentId;
    @ApiModelProperty("组织机构代码")
    private String orgCode;
    @ApiModelProperty("删除标记")
    private String deleteFlag;
}
